define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.uploadfile/index',
        add_url: 'system.uploadfile/add',
        edit_url: 'system.uploadfile/edit',
        delete_url: 'system.uploadfile/delete',
        modify_url: 'system.uploadfile/modify',
        export_url: 'system.uploadfile/export',
    };

    return {

        index: function () {
            ea.table.render({
                init: init,

                toolbar: ['refresh'],
                cols: [[
                    { field: 'id', width: 80, title: 'ID', search: false, width: 100 },
                    { field: 'new_name', title: '文件新名' },
                    { field: 'original_name', title: '文件原名' },
                    { field: 'date_range', title: '提取范围', search: false },
                    { field: 'file_ext', title: '文件类型', search: false, width: 120 },
                    { title: '操作', templet: ea.table.tool, operat: ['delete'], width: 150, }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
        password: function () {
            ea.listen();
        }
    };
});